package com.apexedu.identity.service.impl;

import com.apexedu.framework.service.impl.AbstractBaseServiceSupport;
import com.apexedu.framework.util.Pager;
import com.apexedu.identity.action.IdRoleButtonAction;
import com.apexedu.identity.entity.TSysRole;
import com.apexedu.identity.service.IdRoleButtonService;
import com.apexedu.util.StringUtil;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by wangjian on 14-4-15.
 */
@Service("idRoleButtonService")
public class IdRoleButtonServiceImpl extends AbstractBaseServiceSupport implements IdRoleButtonService {
    @Override
    public void saveOrUpdate(Object myaction) throws Exception {

    }

    @Override
    public void load(Object myaction) throws Exception {

    }

    @Override
    public List<?> list(Object myaction, Pager pager) throws Exception {
        IdRoleButtonAction action = (IdRoleButtonAction) myaction;
        String beLongToApp=action.getParameter("appId");//系统接入号
        String rolesId=action.getParameter("rolesId");//角色编号
        String hql = "from TSysRole t where t.state = '1' and t.belongtoapp = ? ";
        List<TSysRole> list=getBaseDao().findByHql(hql,beLongToApp);
        action.setParameter("IdRoles",rolesId);
        return list;
    }

    @Override
    public boolean remove(Object myaction) throws Exception {
        return false;
    }
}
